Integrand size = 15, antiderivative size = 62 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\frac {\sin (a+b x)}{2 b}+\frac {\sin (a-2 c+(b-2 d) x)}{4 (b-2 d)}+\frac {\sin (a+2 c+(b+2 d) x)}{4 (b+2 d)} \]
[Out]
Time = 0.06 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4666, 2717} \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\frac {\sin (a+x (b-2 d)-2 c)}{4 (b-2 d)}+\frac {\sin (a+x (b+2 d)+2 c)}{4 (b+2 d)}+\frac {\sin (a+b x)}{2 b} \]
[In]
[Out]
Rule 2717
Rule 4666
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {1}{2} \cos (a+b x)+\frac {1}{4} \cos (a-2 c+(b-2 d) x)+\frac {1}{4} \cos (a+2 c+(b+2 d) x)\right ) \, dx \\ & = \frac {1}{4} \int \cos (a-2 c+(b-2 d) x) \, dx+\frac {1}{4} \int \cos (a+2 c+(b+2 d) x) \, dx+\frac {1}{2} \int \cos (a+b x) \, dx \\ & = \frac {\sin (a+b x)}{2 b}+\frac {\sin (a-2 c+(b-2 d) x)}{4 (b-2 d)}+\frac {\sin (a+2 c+(b+2 d) x)}{4 (b+2 d)} \\ \end{align*}
Time = 0.86 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.11 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\frac {1}{4} \left (\frac {2 \cos (b x) \sin (a)}{b}+\frac {2 \cos (a) \sin (b x)}{b}+\frac {\sin (a-2 c+b x-2 d x)}{b-2 d}+\frac {\sin (a+2 c+b x+2 d x)}{b+2 d}\right ) \]
[In]
[Out]
Time = 0.52 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.92
method | result | size |
default | \(\frac {\sin \left (x b +a \right )}{2 b}+\frac {\sin \left (a -2 c +\left (b -2 d \right ) x \right )}{4 b -8 d}+\frac {\sin \left (a +2 c +\left (b +2 d \right ) x \right )}{4 b +8 d}\) | \(57\) |
parallelrisch | \(\frac {b \left (b +2 d \right ) \sin \left (a -2 c +\left (b -2 d \right ) x \right )+2 \left (\frac {b \sin \left (a +2 c +\left (b +2 d \right ) x \right )}{2}+\sin \left (x b +a \right ) \left (b +2 d \right )\right ) \left (b -2 d \right )}{4 b^{3}-16 b \,d^{2}}\) | \(73\) |
risch | \(\frac {\sin \left (x b +a \right )}{2 b}+\frac {\sin \left (x b -2 d x +a -2 c \right ) b}{4 \left (b -2 d \right ) \left (b +2 d \right )}+\frac {\sin \left (x b -2 d x +a -2 c \right ) d}{2 \left (b -2 d \right ) \left (b +2 d \right )}+\frac {\sin \left (x b +2 d x +a +2 c \right ) b}{4 \left (b -2 d \right ) \left (b +2 d \right )}-\frac {\sin \left (x b +2 d x +a +2 c \right ) d}{2 \left (b -2 d \right ) \left (b +2 d \right )}\) | \(133\) |
norman | \(\frac {-\frac {4 d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2}-4 d^{2}}+\frac {4 d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{b^{2}-4 d^{2}}+\frac {4 d \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2}-4 d^{2}}-\frac {4 d \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{b^{2}-4 d^{2}}+\frac {2 \left (b^{2}-2 d^{2}\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{\left (b^{2}-4 d^{2}\right ) b}+\frac {2 \left (b^{2}-2 d^{2}\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{\left (b^{2}-4 d^{2}\right ) b}-\frac {4 \left (b^{2}+2 d^{2}\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{b \left (b^{2}-4 d^{2}\right )}}{\left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}\) | \(275\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.02 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=-\frac {2 \, b d \cos \left (b x + a\right ) \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (b^{2} \cos \left (d x + c\right )^{2} - 2 \, d^{2}\right )} \sin \left (b x + a\right )}{b^{3} - 4 \, b d^{2}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 405 vs. \(2 (49) = 98\).
Time = 0.76 (sec) , antiderivative size = 405, normalized size of antiderivative = 6.53 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\begin {cases} x \cos {\left (a \right )} \cos ^{2}{\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\left (\frac {x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {\sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d}\right ) \cos {\left (a \right )} & \text {for}\: b = 0 \\- \frac {x \sin {\left (a - 2 d x \right )} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2} - \frac {x \sin ^{2}{\left (c + d x \right )} \cos {\left (a - 2 d x \right )}}{4} + \frac {x \cos {\left (a - 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} - \frac {\sin {\left (a - 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{2 d} - \frac {\sin {\left (c + d x \right )} \cos {\left (a - 2 d x \right )} \cos {\left (c + d x \right )}}{4 d} & \text {for}\: b = - 2 d \\\frac {x \sin {\left (a + 2 d x \right )} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2} - \frac {x \sin ^{2}{\left (c + d x \right )} \cos {\left (a + 2 d x \right )}}{4} + \frac {x \cos {\left (a + 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {\sin {\left (a + 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{2 d} - \frac {\sin {\left (c + d x \right )} \cos {\left (a + 2 d x \right )} \cos {\left (c + d x \right )}}{4 d} & \text {for}\: b = 2 d \\\frac {b^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac {2 b d \sin {\left (c + d x \right )} \cos {\left (a + b x \right )} \cos {\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac {2 d^{2} \sin {\left (a + b x \right )} \sin ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac {2 d^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 416 vs. \(2 (56) = 112\).
Time = 0.27 (sec) , antiderivative size = 416, normalized size of antiderivative = 6.71 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=-\frac {{\left (b^{2} \sin \left (2 \, c\right ) - 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left ({\left (b + 2 \, d\right )} x + a + 4 \, c\right ) - {\left (b^{2} \sin \left (2 \, c\right ) - 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left ({\left (b + 2 \, d\right )} x + a\right ) - {\left (b^{2} \sin \left (2 \, c\right ) + 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left (-{\left (b - 2 \, d\right )} x - a + 4 \, c\right ) + {\left (b^{2} \sin \left (2 \, c\right ) + 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left (-{\left (b - 2 \, d\right )} x - a\right ) + 2 \, {\left (b^{2} \sin \left (2 \, c\right ) - 4 \, d^{2} \sin \left (2 \, c\right )\right )} \cos \left (b x + a + 2 \, c\right ) - 2 \, {\left (b^{2} \sin \left (2 \, c\right ) - 4 \, d^{2} \sin \left (2 \, c\right )\right )} \cos \left (b x + a - 2 \, c\right ) - {\left (b^{2} \cos \left (2 \, c\right ) - 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left ({\left (b + 2 \, d\right )} x + a + 4 \, c\right ) - {\left (b^{2} \cos \left (2 \, c\right ) - 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left ({\left (b + 2 \, d\right )} x + a\right ) + {\left (b^{2} \cos \left (2 \, c\right ) + 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left (-{\left (b - 2 \, d\right )} x - a + 4 \, c\right ) + {\left (b^{2} \cos \left (2 \, c\right ) + 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left (-{\left (b - 2 \, d\right )} x - a\right ) - 2 \, {\left (b^{2} \cos \left (2 \, c\right ) - 4 \, d^{2} \cos \left (2 \, c\right )\right )} \sin \left (b x + a + 2 \, c\right ) - 2 \, {\left (b^{2} \cos \left (2 \, c\right ) - 4 \, d^{2} \cos \left (2 \, c\right )\right )} \sin \left (b x + a - 2 \, c\right )}{8 \, {\left (b^{3} \cos \left (2 \, c\right )^{2} + b^{3} \sin \left (2 \, c\right )^{2} - 4 \, {\left (b \cos \left (2 \, c\right )^{2} + b \sin \left (2 \, c\right )^{2}\right )} d^{2}\right )}} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.90 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\frac {\sin \left (b x + 2 \, d x + a + 2 \, c\right )}{4 \, {\left (b + 2 \, d\right )}} + \frac {\sin \left (b x - 2 \, d x + a - 2 \, c\right )}{4 \, {\left (b - 2 \, d\right )}} + \frac {\sin \left (b x + a\right )}{2 \, b} \]
[In]
[Out]
Time = 22.14 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.58 \[ \int \cos (a+b x) \cos ^2(c+d x) \, dx=\frac {\sin \left (a+b\,x\right )}{2\,b}-\frac {d\,\left (2\,b\,\sin \left (a-2\,c+b\,x-2\,d\,x\right )-2\,b\,\sin \left (a+2\,c+b\,x+2\,d\,x\right )\right )+b^2\,\sin \left (a-2\,c+b\,x-2\,d\,x\right )+b^2\,\sin \left (a+2\,c+b\,x+2\,d\,x\right )}{16\,b\,d^2-4\,b^3} \]
[In]
[Out]